<extend  name="Public:base" />
<block name="head">
    <style>
        .layui-form-label{
            width: 90px;
        }
    </style>
</block>
<block name="content_header">
    <div class="content-header">
        <h2 class="content-title">密码修改</h2>
        <span class="layui-breadcrumb">
            <a href="{:U('Index/index')}">首页</a>
            <a>系统管理</a>
            <a><cite>密码修改</cite></a>
        </span>
    </div>
</block>
<block name="toolbar"></block>
<block name="content_body">
    <form class="layui-form">

        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="hidden" name="id" value="{$admin.id}">
                <input type="text" value="{$admin.username}" readonly placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">请输入原密码</label>
            <div class="layui-input-inline">
                <input type="password" name="oldpassword" value="" placeholder="请输入原密码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" value="" placeholder="请输入新密码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">重复密码</label>
            <div class="layui-input-inline">
                <input type="password" name="repassword" value="" placeholder="重复密码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"> </label>
            <div class="layui-input-inline">
                <button class="layui-btn" lay-submit lay-filter="submit">保存</button>
                <button class="layui-btn" type="reset" lay-reset lay-filter="reset">重置</button>
            </div>
        </div>
    </form>
</block>
<block name="foot_script">
    <script>
        //JavaScript代码区域
        layui.use('form', function(){
            var form = layui.form;
            form.on('submit(submit)',function (data) {
                $.post('{:U("Config/modadmin")}',data.field,function (res) {
                    layer.msg(res.msg,{time:1000});
                });
                return false;
            });
        });
    </script>
</block>